This invention relates to colour processors for digital image processing and methods for mapping between different colour gamuts.
In digital image processing, the values describing the colours of an image can often be manipulated so as to end up outside the possible range of colours available in the working colour gamut. This is a particular problem when converting an image between colour gamuts because values lying towards the extremes of the possible range of colours in the source colour gamut will often end up outside the possible range of colours in the destination colour gamut.
This problem has been addressed by clamping or clipping each of the colour channels of the destination gamut to its limits such that any values which exceed the limit of a destination colour channel are simply clamped to the limit of that channel. Colours which do not lie outside the destination gamut are left unchanged. However, this solution leads to unrealistic colours and loss of detail in colours in the region of the boundary of the destination colour gamut. An improvement on this technique has been to clamp the colours of an image which lie outside the destination gamut to values on the surface of the destination colour gamut whilst maintaining constant luma and hue of those values. Only the saturation of the colour therefore changes. Perceptually, this generally yields a processed image which suffers less from colour distortion.
Such gamut mappings are typically performed in YUV space because points of constant luma (Y) and hue in YUV space lie along a conveniently described line. The relationship between luminance LUV, hue HUV and saturation SUV, and the parameters of the YUV colour space can be expressed as follows:
                                          L            UV                    =          Y                ⁢                                  ⁢                              H            UV                    =                                    tan                              -                1                                      ⁡                          (                              V                U                            )                                      ⁢                                  ⁢                              S            UV                    =                                                    U                2                            +                              V                2                                                                        (        1        )            
In YUV space, a destination colour value would therefore conventionally be found where the line of constant luminance and hue passing through the source point in YUV space meets the surface of the destination colour gamut as expressed in YUV space. For example, FIG. 1 shows an RGB colour gamut 101 which is cuboid in shape in YUV colour space 102. A colour value 103 lying outside of the RGB gamut (e.g. a colour value in a YUV image being converted into the RGB gamut) can be clamped to a value 104 on the surface of the RGB cuboid along a line 105 of constant luminance and hue such that the Y value of the destination point 104 on the surface of the RGB cuboid has the same Y value as the source point 103, and the hue function of U and V at the source and destination points yield the same hue value. Converted colour points inside the RGB gamut are not modified.
Colour values can be readily converted between RGB and YUV descriptions. For example, conversion between an sRGB colour space and YUV can be performed according to the following linear transformations:
                              (                                                    Y                                                                    U                                                                    V                                              )                =                                            (                                                                    0.299                                                        0.587                                                        0.114                                                                                                              -                      0.147                                                                                                  -                      0.289                                                                            0.436                                                                                        0.615                                                                              -                      0.515                                                                                                  -                      0.100                                                                                  )                        ⁢                                          (                                                                            R                                                                                                  G                                                                                                  B                                                                      )                            .                                                          ⁢                              (                                                                            R                                                                                                  G                                                                                                  B                                                                      )                                              =                                    (                                                                    1                                                        0                                                        1.140                                                                                        1                                                                              -                      0.395                                                                                                  -                      0.581                                                                                                            1                                                        2.032                                                        0                                                              )                        ⁢                                          (                                                                            Y                                                                                                  U                                                                                                  V                                                                      )                            .                                                          (        2        )            
A second improvement to the simplistic technique of clamping colour values to the limits of the respective colour channels is to scale all of the colours in a source image such that they lie within the destination gamut. This gamut scaling is typically performed at constant luminance and hue and can again be expressed in the YUV colour space as a translation of a source colour value to a destination colour value along a line of constant luminance and hue. With gamut scaling, however, all of the colour values of a source image are converted, and the destination colour values can lie within as well as on the surface of the destination colour gamut.
FIG. 2 shows a two-dimensional representation of such a gamut scaling operation, with a source colour value 201 being mapped to a destination colour value 202 (e.g. FIG. 2 could be a slice through FIG. 1 at constant luma, Y). It can be seen that the source value 201 lies within the source colour gamut 203, which extends out to point 206 on the indicated line 208 of constant luminance and hue. The source value is consequently mapped to a colour value 202 within the destination gamut 204, which extends out to point 207 on the indicated line 208 of constant luminance and hue.
Gamut colour scaling is typically performed by means of a scaling factor along line 208 such that the point 206 on the surface of the source gamut 203 is mapped to point 207 on the surface of the destination gamut 204. All other points between the luma axis 205 and the surface of the source gamut can be scaled by the same scaling factor so as to compress source colour values lying along the line of constant luminance and hue into the destination gamut 204. Gamut scaling therefore preserves the relationship between colours in an image but it necessarily leads to the modification of all the colours in an image, even if those colours lie entirely within the destination gamut. This can lead to large and unnecessary changes to images when only a small number of pixels have colours lying outside the destination colour gamut.
Both gamut clamping and gamut scaling can thus introduce significant colour distortions into a processed image that is converted between colour gamuts. This can be particularly noticeable in videos whose frames are converted between colour gamuts.